package cn.edu.nju.software.cdiy.bean;

import java.io.Serializable;
import java.util.Date;
import java.util.Set;

public class Monitor extends Hardware implements Comparable<Monitor>, Serializable {

	private static final long serialVersionUID = 8398800990213062243L;
	private int id;
	// 型号1
	private String model;// 显示器型号

	// 外键品牌表1
	private BRD_MONITOR brand;// 显示器品牌

	// 外键码表7
	private Value type;// 显示器类型
	private Value productOrientation;// 产品定位
	private Value screenSize;// 屏幕尺寸
	private Value screenRatio;// 屏幕比例
	private Value panelType;// 面板类型
	private Value optimumResolution;// 最佳分辨率
	private Value backlightType;// 背光类型

	// 一对多
	private Set<MON_VideoInterface> moniSet;// 视频接口

	// 次要指标15
	private int brightness;// 亮度
	private String dynamicContrast;// 动态对比度
	private String staticContrast;// 静态对比度
	private int grayResponseTime;// 灰度响应时间
	private String horiAngle;// 水平可视角度
	private String vertAngle;// 垂直可视角度
	private double displayColor;// 显示颜色
	private double ratedPower;// 额定功率
	private String attachment;// 附件
	private String appearanceDesign;// 外观设计
	private String other;// 其他
	private String CSPhone;// 客服电话
	private String qualityPolicy;// 质保政策
	private String qualityTime;// 质保时间
	private String qualityContent;// 质保具体内容

	// 管理类参数6
	private int iPrice;// 入库价格
	private int oPrice;// 出库价格
	private double performance;// 性能
	private Date inStorageTime;// 入库时间
	private String imgPath;// 图片路径
	private Value state;// 状态 //外键；{0:审核中 1:已通过}
	private double wScore;// 网友评分
	private double zScore;// 专家评分
	private int supplier;// 供货商

	private int sale;// 销售量
	private String rsv2;// 预留信息
	private String rsv3;// 预留信息

	public Set<MON_VideoInterface> getMoniSet() {
		return moniSet;
	}

	public void setMoniSet(Set<MON_VideoInterface> moniSet) {
		this.moniSet = moniSet;
	}

	public String getModel() {
		return model;
	}

	public void setModel(String model) {
		this.model = model;
	}

	public BRD_MONITOR getBrand() {
		return brand;
	}

	public void setBrand(BRD_MONITOR brand) {
		this.brand = brand;
	}

	public Value getType() {
		return type;
	}

	public void setType(Value type) {
		this.type = type;
	}

	public Value getProductOrientation() {
		return productOrientation;
	}

	public void setProductOrientation(Value productOrientation) {
		this.productOrientation = productOrientation;
	}

	public Value getScreenSize() {
		return screenSize;
	}

	public void setScreenSize(Value screenSize) {
		this.screenSize = screenSize;
	}

	public Value getScreenRatio() {
		return screenRatio;
	}

	public void setScreenRatio(Value screenRatio) {
		this.screenRatio = screenRatio;
	}

	public Value getPanelType() {
		return panelType;
	}

	public void setPanelType(Value panelType) {
		this.panelType = panelType;
	}

	public Value getOptimumResolution() {
		return optimumResolution;
	}

	public void setOptimumResolution(Value optimumResolution) {
		this.optimumResolution = optimumResolution;
	}

	public Value getBacklightType() {
		return backlightType;
	}

	public void setBacklightType(Value backlightType) {
		this.backlightType = backlightType;
	}

	public int getBrightness() {
		return brightness;
	}

	public void setBrightness(int brightness) {
		this.brightness = brightness;
	}

	public int getGrayResponseTime() {
		return grayResponseTime;
	}

	public void setGrayResponseTime(int grayResponseTime) {
		this.grayResponseTime = grayResponseTime;
	}

	public String getDynamicContrast() {
		return dynamicContrast;
	}

	public void setDynamicContrast(String dynamicContrast) {
		this.dynamicContrast = dynamicContrast;
	}

	public String getStaticContrast() {
		return staticContrast;
	}

	public void setStaticContrast(String staticContrast) {
		this.staticContrast = staticContrast;
	}

	public String getHoriAngle() {
		return horiAngle;
	}

	public void setHoriAngle(String horiAngle) {
		this.horiAngle = horiAngle;
	}

	public String getVertAngle() {
		return vertAngle;
	}

	public void setVertAngle(String vertAngle) {
		this.vertAngle = vertAngle;
	}

	public double getDisplayColor() {
		return displayColor;
	}

	public void setDisplayColor(double displayColor) {
		this.displayColor = displayColor;
	}

	public double getRatedPower() {
		return ratedPower;
	}

	public void setRatedPower(double ratedPower) {
		this.ratedPower = ratedPower;
	}

	public String getAttachment() {
		return attachment;
	}

	public void setAttachment(String attachment) {
		this.attachment = attachment;
	}

	public String getAppearanceDesign() {
		return appearanceDesign;
	}

	public void setAppearanceDesign(String appearanceDesign) {
		this.appearanceDesign = appearanceDesign;
	}

	public String getOther() {
		return other;
	}

	public void setOther(String other) {
		this.other = other;
	}

	public String getCSPhone() {
		return CSPhone;
	}

	public void setCSPhone(String cSPhone) {
		CSPhone = cSPhone;
	}

	public String getQualityPolicy() {
		return qualityPolicy;
	}

	public void setQualityPolicy(String qualityPolicy) {
		this.qualityPolicy = qualityPolicy;
	}

	public String getQualityTime() {
		return qualityTime;
	}

	public void setQualityTime(String qualityTime) {
		this.qualityTime = qualityTime;
	}

	public String getQualityContent() {
		return qualityContent;
	}

	public void setQualityContent(String qualityContent) {
		this.qualityContent = qualityContent;
	}

	public int getiPrice() {
		return iPrice;
	}

	public void setiPrice(int iPrice) {
		this.iPrice = iPrice;
	}

	public int getoPrice() {
		return oPrice;
	}

	public void setoPrice(int oPrice) {
		this.oPrice = oPrice;
	}

	public double getPerformance() {
		return performance;
	}

	public void setPerformance(double performance) {
		this.performance = performance;
	}

	public Date getInStorageTime() {
		return inStorageTime;
	}

	public void setInStorageTime(Date inStorageTime) {
		this.inStorageTime = inStorageTime;
	}

	public String getImgPath() {
		return imgPath;
	}

	public void setImgPath(String imgPath) {
		this.imgPath = imgPath;
	}

	public Value getState() {
		return state;
	}

	public void setState(Value state) {
		this.state = state;
	}

	public double getwScore() {
		return wScore;
	}

	public void setwScore(double wScore) {
		this.wScore = wScore;
	}

	public double getzScore() {
		return zScore;
	}

	public void setzScore(double zScore) {
		this.zScore = zScore;
	}

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public int getSupplier() {
		return supplier;
	}

	public void setSupplier(int supplier) {
		this.supplier = supplier;
	}

	public int getSale() {
		return sale;
	}

	public void setSale(int sale) {
		this.sale = sale;
	}

	public String getRsv2() {
		return rsv2;
	}

	public void setRsv2(String rsv2) {
		this.rsv2 = rsv2;
	}

	public String getRsv3() {
		return rsv3;
	}

	public void setRsv3(String rsv3) {
		this.rsv3 = rsv3;
	}

	@Override
	public int compareTo(Monitor o) {

		Date now = new Date();

		// this的热度

		long gap = now.getTime() - inStorageTime.getTime();
		int gapDay = (int) (gap / (24 * 3600 * 1000));

		double nowHot = sale / gapDay;

		// 参数的hot
		long oGap = now.getTime() - o.getInStorageTime().getTime();
		int oGapDay = (int) (oGap / (24 * 3600 * 1000)) + 1;

		double oHot = o.getSale() / oGapDay;

		// 降序排列
		if (nowHot > oHot)
			return -1;
		else if (nowHot == oHot)
			return 0;
		else
			return 1;
	}

}
